<template>
  <view class="checkbox-group">
    <slot />
  </view>
</template>

<script setup lang="ts">
  import { ref, provide } from 'vue'
  const children = ref([])
  const emit = defineEmits(['change'])

  const emitEvent = () => {
    emit('change', children.value)
  }

  provide('checkboxProvide', {
    children,
    emitEvent,
  })
</script>

<style lang="less" scoped>
  .checkbox-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
</style>
